<?php
class Penerbit_model extends CI_Model{

		function __construct(){
			parent::__construct();
		
		
		}
		
		function getPenerbit($query=FALSE,$id_penerbit=FALSE,$limit=FALSE,$offset=FALSE){
				if ($query == 'list') {
				$this->db->limit($limit,$offset);
					return $this->db->get('tb_penerbit')->result_array();
				}
				
				elseif($query == 'by_id') {
					$this->db->where('id_penerbit',$id_penerbit);
					return $this->db->get('tb_penerbit')->row();
				}
				
		
		
		}
		
		function addPenerbit($data) {
			$this->db->insert('tb_penerbit',$data);
			}
		function editPenerbit($id,$data) {
				$this->db->where('id_penerbit',$id);
				$this->db->update('tb_penerbit',$data);
			}
			
		function deletePenerbit($id) {
				$this->db->where('id_penerbit',$id);
				$this->db->delete('tb_penerbit');
			}

}

?>